Ubuntu 16.04 greenplum详细搭建过程 您所在的位置:网站首页 greenplum 表大小 Ubuntu 16.04 greenplum详细搭建过程

Ubuntu 16.04 greenplum详细搭建过程

2023-05-15 22:25| 来源: 网络整理| 查看: 265

硬件环境准备操作系统:Ubuntu 16.04

首先在服务器新建三台虚拟机,IP分别为:192.168.137.212,192.168.137.213,192.168.137.214;

确定192.168.137.212作为master节点,192.168.137.213,192.168.137.214作为segment节点;

具体搭建过程搭建前准备

修改/etc/hosts 文件

将三台机器的hostname分别修改为mdw,sdw1,sdw2,重启计算机生效;

关闭防火墙

/etc/init.d/ufw stop

安装sudo apt-get install -y software-properties-common

sudo add-apt-repository ppa:greenplum/db

sudo apt-get update

sudo apt-get install -y greenplum-db-oss

修改/etc/sysctl.conf,添加

kernel.shmmax = 500000000

kernel.shmmni = 4096

kernel.shmall = 4000000000

kernel.sem = 250 512000 100 2048

kernel.sysrq = 1

kernel.core_uses_pid = 1

kernel.msgmnb = 65536

kernel.msgmax = 65536

kernel.msgmni = 2048

net.ipv4.tcp_syncookies = 1

net.ipv4.conf.default.accept_source_route =

net.ipv4.tcp_tw_recycle = 1

net.ipv4.tcp_max_syn_backlog = 4096

net.ipv4.conf.all.arp_filter = 1

net.ipv4.ip_forward=

net.ipv4.ip_local_port_range = 1025 65535

net.core.netdev_max_backlog = 10000

net.core.rmem_max = 2097152

net.core.wmem_max = 2097152

vm.overcommit_memory = 2

配置/etc/security/limits.conf,添加

* soft nofile 65536

* hard nofile 65536 * soft nproc 131072

* hard nproc 131072

设置预读块大小

/sbin/blockdev –setra 16384 /dev/sda

重启系统

初始化变量

su root

source /opt/gpdb/greenplum_path.sh

创建主机文件all_hosts

运行gpseginstall工具

gpseginstall -f all_hosts -u wad -p 19841222

有可能免密失败解决方法:su wad

source /opt/gpdb/greenplum_path.sh

gpssh-exkeys -f all_hosts

验证安装及免密登陆

gpssh -f all_hosts -e ls $GPHOME

重要:必须在每台机器都设置免密登陆,否则下面初始化会报错

将source /opt/gpdb/greenplum_path.sh添加到.bashrc文件后(所有的节点都要做)

创建存储区域a) 创建Master数据存储区域mkdir -p /data/master

b)改变目录所有权

chown wad /data/master

c)创建包含所有segment主机的文件seg_hosts

su root

source /opt/gpdb/greenplum_path.sh

gpssh-exkeys -f all_hosts

gpssh -f seg_hosts -e 'mkdir -p /data/primary'

gpssh -f seg_hosts -e 'mkdir -p /data/mirror'

gpssh -f seg_hosts -e ‘chown wad /data/primary'gpssh -f seg_hosts -e ‘chown wad /data/mirror'

同步系统时间在各个机器安装 ntp

a.

gpssh -f all_hosts -e 'apt install -y ntp'

b. 修改/etc/ntp.conf添加

server mdw

c.

gpssh -f /data/all_hosts -e 'ntpd'

初始化GP数据库系统

su wad

cp /opt/gpdb/docs/cli_help/gpconfigs/gpinitsystem_config ~/gpinitsystem_config

chmod 775 gpinitsystem_config

sudo vi gpinitsystem_config

具体配置文件信息如下:

ARRAY_NAME="Greenplum Data Platform"

SEG_PREFIX=gpseg

PORT_BASE=40000

declare -a DATA_DIRECTORY=(/data/primary)

MASTER_HOSTNAME=mdw

MASTER_DIRECTORY=/data/master

MASTER_PORT=5432

TRUSTED_SHELL=ssh

CHECK_POINT_SEGMENTS=8

ENCODING=UNICODE

MACHINE_LIST_FILE=/home/wad/all_segs

运行初始化工具

sudo vim all_segs

gpinitsystem -c gpinitsystem_config -h seg_hosts

设置环境变量添加

export MASTER_DATA_DIRECTORY=/data/master/ifreseg-1

到master 的~/.bashrc

在segment机器上做同样的操作

启动停止数据库gpstart

gpstop

验证

psql

本文来源:https://blog.csdn.net/YangPF1910/article/details/90379867



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有